Skip to content

fix(android): preserve account-owned background uploads - #438

Open
veryCrunchy wants to merge 7 commits into
feature/account-credential-slotsfrom
fix/account-background-isolation
Open

fix(android): preserve account-owned background uploads#438
veryCrunchy wants to merge 7 commits into
feature/account-credential-slotsfrom
fix/account-background-isolation

Conversation

@veryCrunchy

@veryCrunchy veryCrunchy commented Sep 1, 2026

Copy link
Copy Markdown
Member

What changed

  • resolve queued Deck attachment uploads through their persisted account owner instead of the active account
  • load that account's credential without changing account selection
  • fail closed when the account is removed or the loaded credential does not match the persisted owner
  • retain the existing encrypted account-scoped queue and upload ambiguity handling

Why

A queued upload for account A was permanently marked failed and its persisted URI capability was released when account B became active. The durable store already recorded A as the owner, but the worker ignored it when choosing credentials.

Validation

On the dedicated Linux build host, from exact parent #436 head cd2b6de4156e42c9be02840d264790dc5c23a4e4:

Limits

  • deterministic tests cover same-server accounts, exact credential selection, missing-owner refusal, and credential mismatch refusal
  • the existing Android instrumented durable-store test covers two accounts with the same remote upload path, but this pass did not start an emulator or repeat that unchanged test
  • no live Nextcloud upload was performed

Found by the code-first account-isolation audit. Depends on #436.

@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 1, 2026 20:57 Destroyed
@obiente-cloud

obiente-cloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

Obiente preview

NC Native · a1116d1d65d4 · Queued

View preview status

View in Obiente

Obiente updates this comment as the preview changes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-04T13:54:49.101411Z a1116d1 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@veryCrunchy veryCrunchy changed the title fix/account background isolation fix(android): preserve account-owned background uploads Sep 1, 2026
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 1, 2026 20:58 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from 8d19892 to 5fee12e Compare September 1, 2026 21:54
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 1, 2026 21:54 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from 5fee12e to 654502d Compare September 3, 2026 20:43
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 3, 2026 20:43 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from 654502d to 2e7e5df Compare September 3, 2026 20:54
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 3, 2026 20:54 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from 2e7e5df to d98ac8b Compare September 3, 2026 21:18
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 3, 2026 21:18 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from d98ac8b to d43e912 Compare September 3, 2026 21:43
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 3, 2026 21:43 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from d43e912 to 26d99f0 Compare September 4, 2026 00:39
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 00:39 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from 26d99f0 to f6abf67 Compare September 4, 2026 01:10
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 01:10 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from f6abf67 to dbc5557 Compare September 4, 2026 01:56
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 01:56 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from dbc5557 to 0fcf2cd Compare September 4, 2026 02:13
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 02:13 Destroyed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0fcf2cd434

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from 0fcf2cd to 19e35dc Compare September 4, 2026 02:26
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from e5c9890 to 16e02eb Compare September 4, 2026 07:59
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 07:59 Destroyed
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 08:04 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from b3924b8 to 3df6577 Compare September 4, 2026 08:31
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 08:31 Destroyed
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 08:36 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from 45835cd to 408c9de Compare September 4, 2026 09:39
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 09:39 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from 408c9de to efc3f39 Compare September 4, 2026 10:33
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 10:33 Destroyed
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 10:39 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from 2b5f509 to 307858b Compare September 4, 2026 11:14
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 11:14 Destroyed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 307858bcc0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@veryCrunchy
veryCrunchy force-pushed the fix/account-background-isolation branch from 307858b to 5e6fc01 Compare September 4, 2026 11:51
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #438 / NC Native September 4, 2026 11:51 Destroyed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 757c4917e0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +5 to +7
internal suspend fun <Result> captureDurableUploadRequestOutcome(
request: suspend () -> Result,
): kotlin.Result<Result> = try {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the upload outcome helper with its owner

This new 13-line production file contains only a single helper used by DeckAttachmentUploadWorker, while AndroidDurableMultipartUploads.kt grows from 792 to exactly 799 lines. The helper is part of that worker's request state transition rather than an independently changing concept, so this splits code solely to stay under the 800-line limit; remove obsolete code to make room for it in the cohesive owner, or extract a genuinely independent upload-execution owner.

AGENTS.md reference: AGENTS.md:L211-L213

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant